package com.mobi.cacti.model;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

import android.util.Log;

public class ReqCactiDataHandler extends DefaultHandler {
	private String tempVal;
	private ReqCactiData oClass;

	public ReqCactiDataHandler() {}

	public ReqCactiData getObj() {
		return oClass;
	}

	public void startElement(String uri, String localName, String qName,Attributes attributes) throws SAXException {
		// reset
		tempVal = "";
		if (localName.equalsIgnoreCase("ReqCactiData")) {
			oClass = new ReqCactiData();
		}
	}

	public void characters(char[] ch, int start, int length) throws SAXException {
		tempVal = new String(ch, start, length);
	}

	public void endElement(String uri, String localName, String qName) throws SAXException 
	{
		if (qName.equalsIgnoreCase("ReqSessionID")){
			oClass.ReqSessionID = tempVal;
		}else if (qName.equalsIgnoreCase("ResSessionID")){	
			oClass.ResSessionID = tempVal;
		}else if (qName.equalsIgnoreCase("Graph_In_cur")){
			oClass.Graph_In_cur = tempVal;
		}else if (qName.equalsIgnoreCase("Graph_In_avg")){	
			oClass.Graph_In_avg = tempVal;
		}else if (qName.equalsIgnoreCase("Graph_In_max")){	
			oClass.Graph_In_max = tempVal;
		}else if (qName.equalsIgnoreCase("Graph_Out_cur")){	
			oClass.Graph_Out_cur = tempVal;
		}else if (qName.equalsIgnoreCase("Graph_Out_avg")){	
			oClass.Graph_Out_avg = tempVal;
		}else if (qName.equalsIgnoreCase("Graph_Out_max")){	
			oClass.Graph_Out_max = tempVal;
		}
	}

}
